package com.ncsc.erp.model;
// Generated 20 มิ.ย. 2557, 12:55:43 by Hibernate Tools 3.4.0.CR1


import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * MmItem generated by hbm2java
 */
@Entity
@Table(name="mm_item"
    ,catalog="ncsc_erp"
)
public class MmItem  implements java.io.Serializable {


     private long itemNo;
     private MmItemGroup mmItemGroup;
     private MmItemType mmItemType;
     private MmItemColor mmItemColor;
     private String itemCode;
     private String itemModelCode;
     private String itemDescr;
     private Short itemStatusIsActive;
     private Date itemEffectiveDate;
     private Date itemExpireDate;
     private BigDecimal itemBalQty;
     private BigDecimal itemPrice;
     private Short itemStatusIsPromotion;
     private Date itemCreatedDtm;
     private Set<PcPurchaseReceiptItem> pcPurchaseReceiptItems = new HashSet<PcPurchaseReceiptItem>(0);
     private Set<MmItemImage> mmItemImages = new HashSet<MmItemImage>(0);
     private Set<PcPurchaseOrderItem> pcPurchaseOrderItems = new HashSet<PcPurchaseOrderItem>(0);
     private Set<PcPurchaseReqItem> pcPurchaseReqItems = new HashSet<PcPurchaseReqItem>(0);
     private Set<MmItemPriceCustGroup> mmItemPriceCustGroups = new HashSet<MmItemPriceCustGroup>(0);
     private Set<SdQuotationItem> sdQuotationItems = new HashSet<SdQuotationItem>(0);
     private Set<SdSaleOrderItem> sdSaleOrderItems = new HashSet<SdSaleOrderItem>(0);

    public MmItem() {
    }

	
    public MmItem(long itemNo, BigDecimal itemBalQty, BigDecimal itemPrice) {
        this.itemNo = itemNo;
        this.itemBalQty = itemBalQty;
        this.itemPrice = itemPrice;
    }
    public MmItem(long itemNo, MmItemGroup mmItemGroup, MmItemType mmItemType, MmItemColor mmItemColor, String itemCode, String itemModelCode, String itemDescr, Short itemStatusIsActive, Date itemEffectiveDate, Date itemExpireDate, BigDecimal itemBalQty, BigDecimal itemPrice, Short itemStatusIsPromotion, Date itemCreatedDtm, Set<PcPurchaseReceiptItem> pcPurchaseReceiptItems, Set<MmItemImage> mmItemImages, Set<PcPurchaseOrderItem> pcPurchaseOrderItems, Set<PcPurchaseReqItem> pcPurchaseReqItems, Set<MmItemPriceCustGroup> mmItemPriceCustGroups, Set<SdQuotationItem> sdQuotationItems, Set<SdSaleOrderItem> sdSaleOrderItems) {
       this.itemNo = itemNo;
       this.mmItemGroup = mmItemGroup;
       this.mmItemType = mmItemType;
       this.mmItemColor = mmItemColor;
       this.itemCode = itemCode;
       this.itemModelCode = itemModelCode;
       this.itemDescr = itemDescr;
       this.itemStatusIsActive = itemStatusIsActive;
       this.itemEffectiveDate = itemEffectiveDate;
       this.itemExpireDate = itemExpireDate;
       this.itemBalQty = itemBalQty;
       this.itemPrice = itemPrice;
       this.itemStatusIsPromotion = itemStatusIsPromotion;
       this.itemCreatedDtm = itemCreatedDtm;
       this.pcPurchaseReceiptItems = pcPurchaseReceiptItems;
       this.mmItemImages = mmItemImages;
       this.pcPurchaseOrderItems = pcPurchaseOrderItems;
       this.pcPurchaseReqItems = pcPurchaseReqItems;
       this.mmItemPriceCustGroups = mmItemPriceCustGroups;
       this.sdQuotationItems = sdQuotationItems;
       this.sdSaleOrderItems = sdSaleOrderItems;
    }
   
     @Id 

    
    @Column(name="ITEM_NO", unique=true, nullable=false)
    public long getItemNo() {
        return this.itemNo;
    }
    
    public void setItemNo(long itemNo) {
        this.itemNo = itemNo;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="ITEM_GROUP_NO")
    public MmItemGroup getMmItemGroup() {
        return this.mmItemGroup;
    }
    
    public void setMmItemGroup(MmItemGroup mmItemGroup) {
        this.mmItemGroup = mmItemGroup;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="ITEM_TYPE_NO")
    public MmItemType getMmItemType() {
        return this.mmItemType;
    }
    
    public void setMmItemType(MmItemType mmItemType) {
        this.mmItemType = mmItemType;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="ITEM_COLOR_NO")
    public MmItemColor getMmItemColor() {
        return this.mmItemColor;
    }
    
    public void setMmItemColor(MmItemColor mmItemColor) {
        this.mmItemColor = mmItemColor;
    }

    
    @Column(name="ITEM_CODE", length=50)
    public String getItemCode() {
        return this.itemCode;
    }
    
    public void setItemCode(String itemCode) {
        this.itemCode = itemCode;
    }

    
    @Column(name="ITEM_MODEL_CODE", length=50)
    public String getItemModelCode() {
        return this.itemModelCode;
    }
    
    public void setItemModelCode(String itemModelCode) {
        this.itemModelCode = itemModelCode;
    }

    
    @Column(name="ITEM_DESCR", length=200)
    public String getItemDescr() {
        return this.itemDescr;
    }
    
    public void setItemDescr(String itemDescr) {
        this.itemDescr = itemDescr;
    }

    
    @Column(name="ITEM_STATUS_IS_ACTIVE")
    public Short getItemStatusIsActive() {
        return this.itemStatusIsActive;
    }
    
    public void setItemStatusIsActive(Short itemStatusIsActive) {
        this.itemStatusIsActive = itemStatusIsActive;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="ITEM_EFFECTIVE_DATE", length=10)
    public Date getItemEffectiveDate() {
        return this.itemEffectiveDate;
    }
    
    public void setItemEffectiveDate(Date itemEffectiveDate) {
        this.itemEffectiveDate = itemEffectiveDate;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="ITEM_EXPIRE_DATE", length=10)
    public Date getItemExpireDate() {
        return this.itemExpireDate;
    }
    
    public void setItemExpireDate(Date itemExpireDate) {
        this.itemExpireDate = itemExpireDate;
    }

    
    @Column(name="ITEM_BAL_QTY", nullable=false, precision=15)
    public BigDecimal getItemBalQty() {
        return this.itemBalQty;
    }
    
    public void setItemBalQty(BigDecimal itemBalQty) {
        this.itemBalQty = itemBalQty;
    }

    
    @Column(name="ITEM_PRICE", nullable=false, precision=15)
    public BigDecimal getItemPrice() {
        return this.itemPrice;
    }
    
    public void setItemPrice(BigDecimal itemPrice) {
        this.itemPrice = itemPrice;
    }

    
    @Column(name="ITEM_STATUS_IS_PROMOTION")
    public Short getItemStatusIsPromotion() {
        return this.itemStatusIsPromotion;
    }
    
    public void setItemStatusIsPromotion(Short itemStatusIsPromotion) {
        this.itemStatusIsPromotion = itemStatusIsPromotion;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="ITEM_CREATED_DTM", length=19)
    public Date getItemCreatedDtm() {
        return this.itemCreatedDtm;
    }
    
    public void setItemCreatedDtm(Date itemCreatedDtm) {
        this.itemCreatedDtm = itemCreatedDtm;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="mmItem")
    public Set<PcPurchaseReceiptItem> getPcPurchaseReceiptItems() {
        return this.pcPurchaseReceiptItems;
    }
    
    public void setPcPurchaseReceiptItems(Set<PcPurchaseReceiptItem> pcPurchaseReceiptItems) {
        this.pcPurchaseReceiptItems = pcPurchaseReceiptItems;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="mmItem")
    public Set<MmItemImage> getMmItemImages() {
        return this.mmItemImages;
    }
    
    public void setMmItemImages(Set<MmItemImage> mmItemImages) {
        this.mmItemImages = mmItemImages;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="mmItem")
    public Set<PcPurchaseOrderItem> getPcPurchaseOrderItems() {
        return this.pcPurchaseOrderItems;
    }
    
    public void setPcPurchaseOrderItems(Set<PcPurchaseOrderItem> pcPurchaseOrderItems) {
        this.pcPurchaseOrderItems = pcPurchaseOrderItems;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="mmItem")
    public Set<PcPurchaseReqItem> getPcPurchaseReqItems() {
        return this.pcPurchaseReqItems;
    }
    
    public void setPcPurchaseReqItems(Set<PcPurchaseReqItem> pcPurchaseReqItems) {
        this.pcPurchaseReqItems = pcPurchaseReqItems;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="mmItem")
    public Set<MmItemPriceCustGroup> getMmItemPriceCustGroups() {
        return this.mmItemPriceCustGroups;
    }
    
    public void setMmItemPriceCustGroups(Set<MmItemPriceCustGroup> mmItemPriceCustGroups) {
        this.mmItemPriceCustGroups = mmItemPriceCustGroups;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="mmItem")
    public Set<SdQuotationItem> getSdQuotationItems() {
        return this.sdQuotationItems;
    }
    
    public void setSdQuotationItems(Set<SdQuotationItem> sdQuotationItems) {
        this.sdQuotationItems = sdQuotationItems;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="mmItem")
    public Set<SdSaleOrderItem> getSdSaleOrderItems() {
        return this.sdSaleOrderItems;
    }
    
    public void setSdSaleOrderItems(Set<SdSaleOrderItem> sdSaleOrderItems) {
        this.sdSaleOrderItems = sdSaleOrderItems;
    }




}


